<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" isELIgnored="true"%>
<%@ include file="/skin.jsp"%>
<%@taglib uri="/WEB-INF/c.tld" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<!--框架必需start-->
<script type="text/javascript" src="<c:out value='${sessionScope.libs}'/>/js/jquery.js"></script>
<script type="text/javascript" src="<c:out value='${sessionScope.libs}'/>/js/language/cn.js"></script>
<script type="text/javascript" src="<c:out value='${sessionScope.libs}'/>/js/framework.js"></script>
<link href="<c:out value='${sessionScope.libs}'/>/css/import_basic.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" type="text/css" id="skin" prePath="<c:out value='${sessionScope.contextPath}'/>/"/>
<link rel="stylesheet" type="text/css" id="customSkin"/>
<!--框架必需end-->

<!--树组件start -->
<script type="text/javascript" src="<c:out value='${sessionScope.libs}'/>/js/tree/ztree/ztree.js"></script>
<link href="<c:out value='${sessionScope.libs}'/>/js/tree/ztree/ztree.css" rel="stylesheet" type="text/css"/>
<!--树组件end -->

<!--布局控件start-->
<script type="text/javascript" src="<c:out value='${sessionScope.libs}'/>/js/nav/layout.js"></script>
<!--布局控件end-->
</head>
<body>
	<div id="layout1">
        <div id="leftCon" position="left" style="" panelTitle="组织机构">
        	<div class="orgTreeContainer">
			<ul id="tree-1" class="ztree ztree_org"></ul>
			</div>
        </div>
        <div id="centerCon" position="center" style="">
				<IFRAME height="100%" width="100%" frameBorder=0 id=frmright name=frmright src="sample3_1.jsp"  allowTransparency="true"></IFRAME>
        </div>
    </div> 
<script type="text/javascript">
	var nodes1 = [
		{ id:1,  parentId:0, name:"中心1", open: true,icon:"<c:out value='${sessionScope.libs}'/>/icons/user_group.gif"},
		{ id:11, parentId:1, name:"部门1",iconOpen:"<c:out value='${sessionScope.libs}'/>/icons/tree_close.gif",iconClose:"<c:out value='${sessionScope.libs}'/>/icons/tree_open.gif",icon:"org_child_icon.gif"},
		{ id:12, parentId:1, name:"部门2",iconOpen:"<c:out value='${sessionScope.libs}'/>/icons/tree_close.gif",iconClose:"<c:out value='${sessionScope.libs}'/>/icons/tree_open.gif",icon:"org_child_icon.gif"},
		{ id:13, parentId:1, name:"部门3",iconOpen:"<c:out value='${sessionScope.libs}'/>/icons/tree_close.gif",iconClose:"<c:out value='${sessionScope.libs}'/>/icons/tree_open.gif",icon:"org_child_icon.gif"},
		{ id:2,  parentId:0, name:"中心2", open: true,icon:"<c:out value='${sessionScope.libs}'/>/icons/user_group.gif"},
		{ id:21, parentId:2, name:"部门4",iconOpen:"<c:out value='${sessionScope.libs}'/>/icons/tree_close.gif",iconClose:"<c:out value='${sessionScope.libs}'/>/icons/tree_open.gif",icon:"org_child_icon.gif"},
		{ id:22, parentId:2, name:"部门5",iconOpen:"<c:out value='${sessionScope.libs}'/>/icons/tree_close.gif",iconClose:"<c:out value='${sessionScope.libs}'/>/icons/tree_open.gif",icon:"org_child_icon.gif"},
		{ id:23, parentId:2, name:"部门6",iconOpen:"<c:out value='${sessionScope.libs}'/>/icons/tree_close.gif",iconClose:"<c:out value='${sessionScope.libs}'/>/icons/tree_open.gif",icon:"org_child_icon.gif"}
	];
	
	var setting = {
		view: {
			showLine: false,
			selectedMulti: false,
			dblClickExpand: false
		},
		callback: {
			onClick: onClick
		}
	};
	function onClick(event, treeId, treeNode){
	    var zTree = $.fn.zTree.getZTreeObj("tree-1");
	    zTree.expandNode(treeNode);
	} 
 

	function initComplete(){
		$("#layout1").layout({ leftWidth: 150,onEndResize:function(){
			  	
			  }}); 
		
		//本地数据源
		$.fn.zTree.init($("#tree-1"),setting, nodes1);
	}
	
	function customHeightSet(contentHeight){
		$(".orgTreeContainer").height(contentHeight-30);
	}
</script>	
</html>